import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiUnavailableException;
import javax.sound.midi.Sequence;
import javax.sound.midi.Sequencer;


public class playsong 
{
	public static void main(String[] args) throws MidiUnavailableException
	{
		Sequencer sequencer;
		sequencer = MidiSystem.getSequencer();
		if (sequencer==null)
		{
			System.out.println("wwhhhhaaaaa");
		}
		else
		{
			sequencer.open();
		}
		try
		{
			String fileName;
			BufferedReader br = new BufferedReader(new FileReader("C://whateverkevinyoufixthissongToOpen.txt"));
			fileName=br.readLine();
			File myMidiFile=new File(fileName);
			Sequence mySeq = MidiSystem.getSequence(myMidiFile);
		    sequencer.setSequence(mySeq);
		    sequencer.start();
		}catch(Exception e)
		{
			try{
				String fileName;
				BufferedReader br = new BufferedReader(new FileReader("/Users/CaseyJr/Documents/Programming/QT Projects/Tessitura/TessituraSubversion/Tessitura/songToOpen.txt"));
				fileName=br.readLine();
				File myMidiFile=new File(fileName);
				Sequence mySeq = MidiSystem.getSequence(myMidiFile);
			    sequencer.setSequence(mySeq);
			    sequencer.start();
			}catch(Exception e2)
			{
				System.out.println("what's going on");
			}
			
		}
	}
}
